// pages/test/test.js
const app = getApp();
var utils = require('../../utils/util.js');
Page({

  /**
   * 页面的初始数据
   */
  data: {
    icon:{ img: '/images/pic/p_2.png'},
    icon1:{ img: '/images/pic/p_1.png'},
    icon2:{ img: '/images/pic/p_3.png'},
    cutover: [
      { name: '积分明细', img: '/images/pic/6.png', id: 1, url: '/pages/jifenDetail/jifenDetail', type: 'cutovers' },
      { name: '主题活动', img: '/images/pic/1.png', id: 2, url: '/pages/active/active', type: 'cutovers' },
      { name: '免费领劵', img: '/images/pic/2.png', id: 3, url: '/pages/coupons/coupons', type: 'cutovers' },
      { name: '自助积分', img: '/images/pic/3.png', id: 4, url: '/pages/jifen/jifen', type: 'cutovers' },
      { name: '会员权益', img: '/images/pic/4.png', id: 5, url: '/pages/member/member', type: 'cutovers' },
      // { name: '在线客服', img: '/images/pic/5.png', id: 6, url: '/pages/contact/contact', type: 'cutovers' },
    ],

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this;
    wx.showLoading({
      title: '加载中',
    })
    var sucFunc = function (that, res) {
      that.setData({
        my:res.data,
        imgPath: app.d.imgPath
      })
      wx.hideLoading();
    }
    var data = { openid: app.d.openid }
    utils.wxRequest(that, app.d.path, "My/index", data, sucFunc);
  },

  /*
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },
  cutover: function (e) {
    var that = this;
    var url = e.currentTarget.id;
    wx.navigateTo({
      url: url
    })
  },
  park: function (e) {
    wx.navigateTo({
      url: "/pages/card/card"
    })
  },
  collect: function (e) {
    wx.navigateTo({
      url: "/pages/collect/collect"
    })
  },
  cutovers: function (e) {
    var that = this;
    var url = e.currentTarget.id;
    wx.navigateTo({
      url: url
    })
  },
  coupon: function (e) {
    wx.navigateTo({
      url: "/pages/coupon/coupon"
    })
  },
  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})